package server.core.base;

public class Ticket extends EntityBase{
	/**
	 * 
	 */
	private static final long serialVersionUID = -7588185603416550528L;
	private Flight flight;
	private boolean availability;
	private User customer;
	private float price;
	public float getPrice() {
		return price;
	}
	
	public String toString(){
		return   "id: "+getId()
				+", Availability: "+isAvailability()
				+", Price: "+getPrice()
				+", Class: "+getTicketClass().toString()
				+", From: "+getFlight().getFrom().getName()
				+", To: "+getFlight().getTo().getName();
//				+", Airliner: "+getFlight().getByAirplane().getName();
	}

	public void setPrice(float price) {
		this.price = price;
	}
	public enum TicketClass{
		first, business, economy;
	}
	private TicketClass ticketClass;
	
	public Ticket(Flight flight, TicketClass ticketClass, float price){
		this.setFlight(flight);
		this.setTicketClass(ticketClass);
		this.setPrice(price);
		setAvailability(true);
		setCustomer(null);
	}

	public Flight getFlight() {
		return flight;
	}
	public void setFlight(Flight flight) {
		this.flight = flight;
	}

	public boolean isAvailability() {
		return availability;
	}
	public void setAvailability(boolean availability) {
		this.availability = availability;
	}

	public User getCustomer() {
		return customer;
	}
	public void setCustomer(User customer) {
		this.customer = customer;
	}

	public TicketClass getTicketClass() {
		return ticketClass;
	}

	public void setTicketClass(TicketClass ticketClass) {
		this.ticketClass = ticketClass;
	}

}
